package sample.spring.ibatis.model;


import org.pojomatic.Pojomatic;
import org.pojomatic.annotations.AutoProperty;

import java.io.Serializable;

@AutoProperty
public class Customer implements Serializable{

	private int customerId;
	private String firstName;
	private String lastName;
	private String mobileNo;
	
	public int getCustomerId() {
		return customerId;
	}
	public void setCustomerId(int customerId) {
		this.customerId = customerId;
	}
	
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	public String getMobileNo() {
		return mobileNo;
	}	
	public void setMobileNo(String mobileNo) {
		this.mobileNo = mobileNo;
	}
	
	public String toXML(){
	    StringBuffer sb = new StringBuffer();
	    sb.append("<customer>")
	        .append("<firstName>"+firstName+"</firstName>")
	        .append("<lastName>"+lastName+"</lastName>")
            .append("<mobileNo>"+mobileNo+"</mobileNo>")
            .append("<customerId>"+customerId+"</customerId>")
            .append("</customer>");
	    return sb.toString();
	}

	@Override public boolean equals(Object o) {
		return Pojomatic.equals(this, o);
	}

	@Override public int hashCode() {
		return Pojomatic.hashCode(this);
	}

	@Override public String toString() {
		return Pojomatic.toString(this);
	}

}
